{extend name="admin/public/base" /}

{block name="content"}
<!-- Content Header (Page header) -->
<section class="content-header">
  <h1>
    缩略图设置
    <small></small>
  </h1>
  <ol class="breadcrumb">
    <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
    <li><a href="#">系统</a></li>
    <li class="active">缩略图设置</li>
  </ol>
</section>

<!-- Main content -->
<section class="content">

    <div class="box box-solid">
           <form method="post" id="form" action="" class="form-horizontal">
              <!-- Custom Tabs -->
              <div class="nav-tabs-custom">
                <ul class="nav nav-tabs">
                  <li class="active"><a href="#tab_1" data-toggle="tab" aria-expanded="true">基本信息</a></li>
                </ul>
                <div class="tab-content">
                  <div class="tab-pane active" id="tab_1">
                                <div class="form-group">
                                    <label class="col-sm-2 control-label">策略</label>
                                    <div class="col-sm-5">
                                        <div class="table-responsive">
                                          <table class="table table-bordered">
                                            <tbody>
                                              <tr>
                                                <td>
                                                    <label class="radio-inline">
                                                        <input type="radio" {eq name="position" value="1"}checked{/eq} name="position" value="1"> 等比例缩放
                                                    </label>
                                                </td>
                                                <td>
                                                    <label class="radio-inline">
                                                        <input type="radio" {eq name="position" value="2"}checked{/eq} name="position" value="2"> 缩放后填充
                                                    </label>
                                                </td>
                                                <td>
                                                    <label class="radio-inline">
                                                        <input type="radio" {eq name="position" value="3"}checked{/eq} name="position" value="3"> 居中裁剪
                                                    </label>
                                                </td>
                                              </tr>
                                              <tr>
                                                <td>
                                                    <label class="radio-inline">
                                                        <input type="radio" {eq name="position" value="4"}checked{/eq} name="position" value="4"> 左上角裁剪
                                                    </label>
                                                </td>
                                                <td>
                                                    <label class="radio-inline">
                                                        <input type="radio" {eq name="position" value="5"}checked{/eq} name="position" value="5"> 右下角裁剪
                                                    </label>
                                                </td>
                                                <td>
                                                    <label class="radio-inline">
                                                        <input type="radio" {eq name="position" value="6"}checked{/eq} name="position" value="6"> 固定尺寸缩放
                                                    </label>
                                                </td>
                                              </tr>
                                            </tbody>
                                          </table>
                                        </div>
                                    </div>
                                </div>
                  </div>
                  <!-- /.tab-pane -->
                </div>
                <!-- /.tab-content -->
                <div class="box-footer">
                  <div class="col-sm-offset-2 col-sm-10">
                    <div class="btn-group">
                        <button class="btn btn-default btn-flat" type="reset">取消</button>
                        <button class="btn btn-primary btn-flat" id="submit" type="submit">保存</button>
                    </div>
                  </div>
                </div>
              </div>
              <!-- nav-tabs-custom -->
            </form>
    </div>

</section>
<!-- /.content -->
{/block}

{block name="js"}

<script>

    $(function(){

        $("#form").validate({
            rules: {
                key: {
                    required: true,
                    maxlength: 150
                },
                name: {
                    required: true,
                    maxlength: 150
                }
            },
            submitHandler: function(form) {
                <!-- alert("submitted!");
                $.ajax({
                    url:"{:url('admin/system/thumb')}",
                    data:$(form).serialize(),
                    type:'post',
                    dataType:'json',
                    success:function(xhr){
                        if(xhr.code == 200){
                            swal({
                                title: xhr.msg,
                                text: "",
                                type: "success",
                                confirmButtonText: '确定',
                                cancelButtonText: '取消',
                            });
                        } else{
                            swal({
                                title: xhr.msg,
                                text: "",
                                type: "error",
                                confirmButtonText: '确定',
                                cancelButtonText: '取消',
                            });
                        }
                    }
                });

            }
        });

    });
</script>
{/block}